Repository navigation
feat(metadata): add eventing and batch API kinds across all ports - #713
Merged
Merged
Conversation
…tracts in every port
Registers api.eventing (operation.event, binding.messaging) and api.batch
(operation.export, operation.import, binding.file) beside api.operational,
experimental since 1.4.0, in TypeScript, C#, Java and Kotlin, Python and Rust.
In the systems vocabulary, resource.stream and resource.queue carry eventing
APIs and resource.objectStore batch APIs (a resource carrying the other kind is
ERR_REF_WRONG_KIND), app.service and app.job provide APIs, and app.job
extracts an entity or projection.
The file conventions are pinned: {date} and {timestamp} in UTC are the only
@filename placeholders, a marker completion is the file's name plus .done, csv
is RFC 4180 with a header row, and fixedWidth is not offered. @availableBy has
one form per frequency, with a day for weekly and monthly files (rules D1 and
D2, ERR_BAD_ATTR_VALUE).
The ADR-0066 operation rules and every generator that reads operations now
take only api.operational, and the TypeScript and Rust service generators pick
the binding.rest by subtype. The inert-codegen corpus gains with-delivery/,
held in every port's test: the new APIs add no output.
Also: the ERR_TRANSITION_NOT_ON_ENTITY text matches TypeScript in every port;
the document/search store recipe names the provider that registers those
sources; the metamodel-version gate no longer reads a member moved off an
abstract anchor, or a wildcard narrowed to its existing subtypes, as breaking;
requirements for the seven new subtypes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
api.eventingandapi.batchto the API metamodel in all five ports (TypeScript, C#, Java/Kotlin, Python, Rust). Eventing holdsoperation.eventwithbinding.messaging. Batch holdsoperation.exportandoperation.import, each with an optionalbinding.file.app.provides,resource.carries(kind-restricted) andapp.job.extractsare also registered.availableBytakes a day for weekly and monthly feeds. File conventions are pinned:{date},{timestamp}, themarkercompletion, and the CSV form.fixedWidthis removed.operation.baseno longer declares attributes. Command and query declare their own. Provider subtypes underapi.operationalare refused unless they are command or query. Java and Kotlin now refuse out-of-set attribute values (ERR_BAD_ATTR_VALUE), matching the other ports.binding.restby subtype. The C# API schema is updated to match. Nothing is generated from the new kinds yet, andmetamodelVersionstays at1.4. New conformance fixtures cover the error cases and the valid eventing/batch system. Inert-codegen tests in each port check that the new kinds emit nothing.Validation
Risk Assessment
Testing
Baseline affected CI passed. Drove three scenarios live through the TS meta CLI against disposable project copies in scratch, which I removed afterwards: a valid api.eventing/api.batch model loads clean; a resource.stream @carries pointing at an api.batch is refused with ERR_REF_WRONG_KIND; a binding.file @Format fixedWidth is refused with ERR_BAD_ATTR_VALUE while csv loads. All three behave as the intent requires. Transcript saved at the evidence directory. Other ports were not driven live.
Evidence: Live scenario transcript (TS meta CLI, three scenarios)
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
examples/showcase/site-payload.json:10- Round 5 reported this, and it is still not fixed. The committed site payload says"fixtures": 620.fixtures/conformance/holds 622 scenario directories, andscripts/site/counts.tsderiveCountscounts exactly those directories. Round 4 addederror-api-binding-file-format-fixed-widthanderror-api-export-frequency-unknownand updated AGENTS.md, docs/CONFORMANCE.md and the RustminPassingto 622, but did not regenerate this file. As a resultbun scripts/build-site-payload.ts --checkfails with "site-payload.json is stale", andgate_site_payloadin the gates lane goes red. Fix: runbun run site:payloadand commit the result (onlycountsshould change).server/java/metadata/src/main/java/com/metaobjects/loader/ValidationPhase.java:191- Round 4 introduced this code, and it goes further than the finding asked. That finding asked for an own-attr closed-set check on the eight new API attrs, like the old@methodcheck. Instead, round 4 added a genericvalidateAllowedValuespass over every attr of every type. It also deleted ReportingValidation'scheckClosedSets(@agg/@grains) and the RulesValidation@methodcheck, and it changed the message format (now prefixedERR_BAD_ATTR_VALUE:).The generic pass puts its findings into
collectedbut not into the message-keyed set (reportingFindings).dedupe(line 372) therefore collapses them by code plus source envelope. Concrete case: adimension.timewith@grains: ["fortnight","decade"]now reports one error in Java. Before round 4 it reported two, keyed by message, and TypeScript reports two. Abinding.filewith a bad@formatand a bad@encryptionalso reports one error. No shared fixture has two bad values on one node, so conformance stays green. The updatedReportingValidationTestcases callvalidateAllowedValuesdirectly, so they never exercise the dedupe.The older membership-only checks that now duplicate the generic pass are still there (
@normalize, source@kind/@role,@onDelete/@onUpdate, identity@generation, template@format/@promptStyle/@responseFormat/@kind, requirement@status). Today the same dedupe hides them, so keying the generic findings by message alone would double-report. Round 5 raised this and it was not fixed.Choose one:
(a) Revert round 4 to the minimal fix: explicit checks for the eight API attrs, plus the restored reporting and
@methodchecks.(b) Keep the generic pass: add its findings to the message-keyed set, remove the duplicate membership checks (keep any part that does more than membership), and add one load-level test with two bad values on one node.
scripts/metamodel-version-exceptions.json:6- Round 4 added this exceptions ledger. Every entry'sreasonends "so no document loses anything". The same round's upgrade note (changelog.d/api-eventing-and-batch.md, "Upgrading") says something different: a project provider's own operation subtype loses@inputRef,@outputRef,@objectRef,@permission,@publicand binding children, and is no longer admitted underapi.operational. The ledger justification therefore contradicts the documented break it excuses. Reword the reason to limit the claim to core subtypes and point to the upgrade note for project providers. The same text is in all nine entries.metaobjects/meta.requirements.yaml:1697- Round 3 rewordedbindingMessagingandoperationExportso that optional attrs readmay name, but it leftbindingFileunchanged. Itslivestatement says a file binding "names where the file is put … its format, compression, encryption and how a reader knows the file is whole".@pathis optional (absent means the top of the store), and@compression,@completionand@encryptionare optional with defaultnone. Reword those as optional or defaulted, then regenerate the five requirement-harness files under fixtures/requirement-harness/, which embed the statement.spec/metamodel/api.json:158- The CSV rule now says a field "is quoted when it holds a comma, a quote, CR or LF". The word "only" from the earlier text is gone, so the sentence no longer says that other fields are left unquoted. One writer that quotes every field and another that quotes only when needed both conform, yet they write different files for the same row. The intent requires the CSV form to be pinned. Restore "only when" and keep the empty-string sentence as the stated exception. The same text is at docs/features/business-rules.md (theformatbullet) and in the generated copies: the C#, Python and Rust api.json, api-definition.embedded.ts, expected-registry.json, fixtures/metamodel-docs binding.md and binding.md.json, and site-reference/types/binding.html. Regenerate those with the repo's generators.🔧 Fix applied.
📝 1 wording or comment-placement note left for the author (no fix round spent):
changelog.d/api-eventing-and-batch.md:39- Fixed inline. The upgrade note told a project that has its own operation subtype to place it under its own API type, but did not say what stops reading it there. Permission names, transition claims,verify's rules check and the generators that read operations take them fromapi.operationalonly; of the operation rules, only O1 applies elsewhere. I added that to the note.🔧 **Test** - 5 issues found → auto-fixed → no changes applied ✅
server/rust/metaobjects/src/validate/rules.rs:932- rustfmt check fails in the rust conformance lane.rest.contains(['{', '}']).then(|| ...)must be wrapped across lines as rustfmt wants (.thenon its own line). Failsconformance: rust, which makesscripts/ci-local.sh --affectedred and the change not mergeable.server/rust/metaobjects-codegen/src/service_routes.rs:342- Same rustfmt failure. Thetree.children(o.names.node).iter().copied().find(...)chain forbindingmust be reflowed to rustfmt layout (one-linefindclosure). Output from the failing lane:Diff in .../service_routes.rs:342.scripts/ci-local.sh- Affected-lane run stopped at the rust lane (log shows only lane rust) so other selected lanes (ts-fast, ts-unit, java-slow, python, csharp, packs) have no result from this run. Rerun the full affected selection after the rustfmt fix to establish their status.Diff in server/rust/metaobjects/src/validate/rules.rs:932and `server/rust/metaobjects-codegen/src/service_rou…scripts/ci-local.sh --affected --strict-toolchainsMO_CI_LIST_ONLY=1 scripts/ci-local.sh --affected --strict-toolchains(lane selection: ts-fast ts-unit java-slow python csharp rust packs)scripts/ci-local.sh --affected --strict-toolchains(real run, log at evidence dir ci-affected.log; rust conformance lane failed, rustfmt diffs)Inspected fixtures/conformance/error-api-binding-file-format-fixed-width/ expected-errors.json (ERR_BAD_ATTR_VALUE expected)🔧 Fix applied.
2 issues (1 error, 1 warning) still open:
scripts/ci-local.sh --affected --strict-toolchainscargo fmt --all --check (server/rust)cargo clippy --workspace --all-targets -- -D warnings (server/rust)scripts/ci-local.sh --affected --strict-toolchains (run twice; second run LOCAL CI PASSED, logs at ~/.no-mistakes/evidence/01M92EEQPZRF2C1QWNEPP79YQX/affected-run2.log)live: node server/typescript/packages/cli/dist/bin/meta.js verify --codegen on scratch project holding fixtures/conformance/error-api-binding-file-format-fixed-width/input with @format fixedWidth -> ERR_BAD_ATTR_VALUElive: same project with @format csv -> metadata loads (only the codegen gate reports no metaobjects.config.ts, unrelated to the change)🔧 No changes applied.
✅ Re-checked - no issues remain.
scripts/ci-local.sh --affected --strict-toolchainsBaseline:scripts/ci-local.sh --affected --strict-toolchains(passed, per step baseline)bun server/typescript/packages/cli/bin/meta.ts verify --depson a disposable project with fixtures/conformance/systems-api-eventing-batch/input (exit 0)meta verify --depson a disposable project with fixtures/conformance/error-ref-wrong-kind-carries-batch-on-stream/input (exit 1, ERR_REF_WRONG_KIND)meta verify --depson fixtures/conformance/error-api-binding-file-format-fixed-width/input with @format fixedWidth (exit 1, ERR_BAD_ATTR_VALUE) and csv control (exit 0)✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → no changes applied ✅
🔧 No changes applied.
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.